package niuke;

import java.io.BufferedReader;
import java.io.InputStreamReader;

public class 统计回文{
    public static void main(String args[]) throws Exception{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String a = br.readLine();
        String b = br.readLine();
        StringBuffer sb = new StringBuffer(a);
        int count = 0;
        for(int i = 0;i<sb.length();i++){
            StringBuffer temp = new StringBuffer(sb);
            temp.insert(i,b);
            if(isPal(temp)){
                count++;
            }
        }
        if(isPal(sb.append(b))){
            count++;
        }
        System.out.println(count);
    }

    public static boolean isPal(StringBuffer sb){
        StringBuffer newSb = new StringBuffer(sb);
        StringBuffer temp = newSb.reverse();
        for(int i = 0;i<(temp.length()/2-1);i++){
            if(sb.charAt(i)!=temp.charAt(i)){
                return false;
            }
        }
        return true;
    }
}
